﻿Imports MeoTom.Core

Partial Public Class Email
    Inherits UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Private Sub btnSend_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSend.Click
        Try
            Dim mailer As New Utilities.Mail(Configs.SmtpHost, Configs.SmtpUser, Configs.SmtpPass, Configs.WebMasterEmail)
            Dim reader As New IO.StreamReader(Configs.FolderSaveData & "EmailContent.htm", Encoding.UTF8)
            Dim strBodyMail As String = reader.ReadToEnd()
            strBodyMail = strBodyMail.Replace("{0}", txtName.Text)
            strBodyMail = strBodyMail.Replace("{1}", txtEmail.Text)
            strBodyMail = strBodyMail.Replace("{2}", Server.UrlDecode(Request.QueryString("vLink")))
            strBodyMail = strBodyMail.Replace("{3}", txtBody.Text)

            mailer.Send(txtEmail.Text, txtSubject.Text, strBodyMail, False, txtEmail2.Text, "", 1)

            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "closeWindows", "window.close();", True)
        Catch

        End Try
    End Sub
End Class